<%@include file="/WEB-INF/acreditacion/includes.jsp"%>
<%@include file="/WEB-INF/acreditacion/libs/utils.jsp" %> 
<util:session validate="true" name="Session2"/>
<%String strRootPath = request.getContextPath();%>

<body class="body">

<%=f_table_head_modules(55)%>

<div style="color: red" id="datagrid"   >
    <div id="idFormulario" >    
    <table width="98%" class="myform" style="margin-top:10px;"  >
        <tr><th class="showtitle1" >
			 <b><samp >LISTA PRIVILEGIOS</samp></b>
	</th></tr>
        <tr><th style="font-size: 15px;color: #D31A11" >
		Nombre: <b><samp><c:out  value="${nombre} ${apellidos}"/></samp></b><br>
	</th></tr>
    </table>
    <form action="savePrivilgio.html?trabajadorid=${trabajadorid}&nombre=${nombre}&apellidos=${apellidos}" name="form" id="form" method="post" >
    <div>
    <table class="myform" width="98%" id="demoTable" >
        <tr><th class="th_viuw">#</th>
            <th class="th_viuw">P&aacute;gina(URL)</th>
            <th class="th_viuw">Nombre</th>
            <th class="th_viuw">Estado</th>
        </tr> 
        
        
    <c:set var="aliasM" value=""> </c:set>    
    <c:set var="i" value="1" />         
    <c:forEach items="${listaAccesoTrabaj}" var="resAT">  
        <c:if test="${resAT.alias!=aliasM}">                                   
                    <tr><th colspan='4' class='showtitle2'><b><c:out value="${resAT.nombremenu}"/></b></th></tr>
        </c:if>        
        
        <c:if test="${i%2==1}"> <tr bgcolor="#DAEFFE"></c:if>
        <c:if test="${i%2!=1}"> <tr></c:if>
                    <td><c:out  value="${i}"/></td>
                    <td><c:out value="${resAT.pagina}"/></td>
                    <td><c:out value="${resAT.nombre}"/></td>
                    <td align="center">      
                        <c:if test="${resAT.estadopri=='1' }">
                            <c:if test="${resAT.estado=='1' }">
                                <img src="<%=strRootPath%>/resources/imagen/icons/activo.gif" border="0" alt="Activo" />
                            </c:if>
                            <c:if test="${resAT.estado!='1' }">
                                <img src="<%=strRootPath%>/resources/imagen/icons/desactivo.gif" border="0" alt="Desactivo" />
                            </c:if>
                        </c:if>
                        <c:if test="${resAT.estadopri!='1' }">
                            <img src="<%=strRootPath%>/resources/imagen/icons/category.gif" border="0" alt="Asignar" />
                        </c:if>                                

                        <input type="checkbox" <c:if test="${resAT.estado=='1' }"><c:out value="checked"/> </c:if>   name="estado[]" 
                               value="<c:out  value="${resAT.idAcceso}-${resAT.estado}-${resAT.estadopri}"/>"> 
                    </td>
            </tr>   
    <c:set var="aliasM" value="${resAT.alias}"> </c:set>             
    <c:set var="i" value="${i+1}"/>              
    </c:forEach>          


    <tr>
    <td align="center" colspan="4">
    <input type="hidden" name="opc" id="opc" value="RA" >
    <input type="submit" value="Actualizar" class="button2" name="buscar" id="buscar">
    <input type="button" value="Finalizar" class="button2" name="cancelar" id="cancelar" onclick="listar('mainPrivilegio.html')" >
    </td>
    </tr>
    </table>
    </div>
    </form>


    </div>
    <form action="mainPrivilegio.html" method="post" id="fm2" name="fm2"> </form>
</div>
<%=f_table_foot_modules()%>
</body>